import { mapGetters } from 'vuex'
export default {
	computed:{
		...mapGetters(['CartTotal'])
	},
	methods: {
		setIcon () {
			uni.setTabBarBadge({
				index: 2,
				text: (this.CartTotal === 0 ?  0 + '' : this.CartTotal + '')
			})
		}
	},
	onShow() {
		this.setIcon()
	},
	watch: {
		CartTotal () {
			this.setIcon()
		}
	}
}